import type { ArmorsModel, ResultModel, PageResultModel,MaterialModel } from '@/api/model/model'
import request from '@/utils/request'


export const queryMaterialPageApi = (pn: Number, pz: Number) => 
  request.get<any, PageResultModel>(`/material/materialList?pn=${pn}&pz=${pz}`)

//根据ID查询armor
export const queryMaterialByIdApi = (id: number) => request.get<any, ResultModel>(`/material/getMaterialsById/${id}`)

export const updateApi = (material:MaterialModel) => request.post<any, ResultModel>(`/material/materialsAddOrUpdate`, material)
export const addApi = (material:MaterialModel) => request.post<any, ResultModel>(`/material/materialsAddOrUpdate`, material)

export const deleteApi = (id: number) => request.delete<any, ResultModel>(`/material/materialsDelById/${id}`)
export const batchDeleteApi = (ids: (number| undefined)[]) => request.post<any, ResultModel>(`/material/materialsBatchDelById`,ids)